
package com.eworking.eim.message.body;

import android.os.Parcel;
import android.os.Parcelable;

public class LocationMessageBody extends MessageBody {
    
    /** 地理位置 */
    public String address;
    
    /** 维度 */
    public double latitude = 0;
    
    /** 经度 */
    public double longitude = 0;
    
    public static final Parcelable.Creator<LocationMessageBody> CREATOR =
        new Parcelable.Creator<LocationMessageBody>() {
            
            @Override
            public LocationMessageBody createFromParcel(Parcel source) {
                return new LocationMessageBody(source);
            }
            
            @Override
            public LocationMessageBody[] newArray(int size) {
                return new LocationMessageBody[size];
            }
        };
    
    public LocationMessageBody(String address, double latitude, double longitude) {
        this.address = address;
        this.latitude = latitude;
        this.longitude = longitude;
    }
    
    public String getAddress() {
        return this.address;
    }
    
    public double getLatitude() {
        return this.latitude;
    }
    
    public double getLongitude() {
        return this.longitude;
    }
    
    public String toString() {
        return "location:" + this.address + ",lat:" + this.latitude + ",lng:" + this.longitude;
    }
    
    public int describeContents() {
        return 0;
    }
    
    public void writeToParcel(Parcel parcel, int paramInt) {
        parcel.writeString(this.address);
        parcel.writeDouble(this.latitude);
        parcel.writeDouble(this.longitude);
    }
    
    private LocationMessageBody(Parcel parcel) {
        this.address = parcel.readString();
        this.latitude = parcel.readDouble();
        this.longitude = parcel.readDouble();
    }
}
